import java.util.Scanner;

class Main {

	static double taylorExp(double x) {
		double sum; // 和
		double numerator; // 分子
		double denominator; // 分母
		double term; // 项

		sum = 0;
		term = 1;
		sum += term;

		numerator = x;
		denominator = 1; // 1的阶乘等于1
		term = numerator / denominator;
		
		int n = 1;

		while (term >= 0.00001) {
			sum += term;
			numerator *= x;
			n++;
			denominator *= n;
			term = numerator / denominator;
		}
		return sum;
	}
	
	public static void main(String[] args) {

		for (double i = 0.2; i <= 1.0; i += 0.2) {
			System.out.println("$ " + taylorExp(i));
			System.out.println("# " + Math.exp(i));
			
		}
		
		
	}
}
